<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<!-- .breadcrumb -->
	</div>
	<!-- Main content -->
	<div class="page-content">
    	<div class="row">
    	    <div class="page-header">
    			<h1>充值进度</h1>
    		</div>
    		
            <input type="hidden" name="upid" id="upid" value=""/>
            <div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								
								<th>手机号</th>
                                <th>加油卡卡号</th>
                                <th>商户订单号</th>
                                <th>聚合订单号</th>
                                <th>待充时间</th>
                                <th>待充金额</th>
								<th>充值结果</th>
                                <th>充值失败原因</th>
                                <th>接口错误原因</th>
                              	<th>操作</th>
                               
							</tr>
						</thead> 
						<tbody>
						<?php if (isset($list)&&count($list)>0){
                            	foreach ($list as $app){
                            	?>
							<tr>
								
                                <td><p><?php echo $app['user_mobile'];?></p></td>
                                <td><p><?php echo $app['fuel_card'];?></p></td>
                                <td><p><?php echo $app['api_order_no'];?></p></td>
                                <td><p><?php echo $app['juhe_order_no'];?></p></td>
                                <td><p><?php echo $app['dateline'];?></p></td>
                                <td><p><?php echo $app['price'];?></p></td>
                                <td>
                                <p>
								<?php 
								
								if($app['success']==0){echo '充值中';}elseif($app['success']==1){echo '充值成功';}elseif($app['success']==9){echo '充值失败';}elseif($app['success']==-1){echo '待充值';}elseif($app['success']==-3){echo '充值终止';}
								
								
								
								
								
								?>
                                
                                </p></td>
                                <td style="width:100px;"><p><?php echo $app['fail_msg'];?></p></td>
								<td style="width:100px;"><p><?php echo $app['error_msg']?></p></td>
                                <td><p>
                                <a class="btn btn-sm btn-info" href="<?php echo base_url().'admin/order/fuel_task_info/'.$app['api_order_no']?>"><i class="icon-edit"></i>查看详情</a>
                                
                                
                                <?php if($app['success']!=1):?><a class="btn btn-danger btn-sm" href="###" onclick="javascript:retry(<?php echo $app['id']?>,this)"><i class="icon-edit"></i>立即充值</a><?php endif;?>
                               </td>
    						</tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="10">无数据</td>
                            </tr>
                            <?php }?>
                            </tbody>
                         </table>
                     </div><!-- /.table-responsive -->
				</div>
                
            </div><!-- /.row -->
		</div><!-- /.page-content -->
	</div><!-- /.main-content -->
    <script>
    
	function retry(tid,t){
		var tip=$(t).text();
		if(tip=='请稍候...'){
			alert('请稍候...');
			return false;
		}
		
		$(t).text('请稍候...');
		
		$.ajax({
		   type: "POST",
		   url: "<?php echo base_url().'admin/order/fuel_task_retry'?>",
		   data: "tid="+tid,
		   dataType:"json",
		   success: function(msg){
			if(msg.error==1){
					alert(msg.msg);
			}else{
				window.location.reload();
			}
			 
			 $(t).text('重新充值');
		   }
		});
	}
    
    </script>